package com.shop.dingdongshoppingapi.controller;

import com.shop.dingdongshoppingapi.dto.UserLoginDto;
import com.shop.dingdongshoppingapi.service.intf.UserService;
import com.shop.dingdongshoppingapi.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/***
 *  .--,       .--,
 * ( (  .---./  ) )
 *  '.__/o   o\__.'
 *     {=  ^  =}
 *      >  -  <
 *     /       
 *    //       \
 *   //|   .   |\
 *   "'       /'"_.-~^`'-.
 *        _  /--'         `
 *    ___)( )(___
 *   (((__) (__)))    高山仰止,景行行止.虽不能至,心向往之。
 */
@RestController
@RequestMapping("/api/my/")
@Api("登录我的接口")
@CrossOrigin    //跨域请求
public class MyController {
    @Resource
    private UserService service;

    //查询登录的用户
    @GetMapping("loginMyUser.do")
    @ApiOperation("查询用户信息")
    public R loginMyUser(HttpServletRequest request){
        return service.loginMyUser(request.getIntHeader("ddstoken"));
    }
}
